<script setup>
import {ref, watch} from 'vue'

const num = ref(100)
const name = ref('李四')

// watch(num, a => {
//   console.log('watch 开始')
//   console.log(a)
//   console.log('watch 结束')
// })

watch([num, name], (nv, ov) => {
  console.log('watch 开始')
  console.log(`num新值：${nv}`)
  console.log(`num旧值：${ov}`)
  console.log('watch 结束')
})
</script>

<template>
  <input v-model.number="num">
</template>
